Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#115230531 Forgot Password #47

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open

Conversation

lewisemm
Copy link
Contributor

@lewisemm lewisemm commented Apr 4, 2016

What does this PR do?

  • This PR provides a password reset feature that allows users to change their password if they forget the current one.

Description of the task to be completed?

  • The task involved creating a Forgot Password? link in the login page. When this link is clicked, a modal dialog is opened and it prompts the user to enter his/her email address.
  • When the user enters an email and clicks the Send Password Reset Email, one of two things can happen;
  • If the user exists in the system, an email with the password reset instructions will be sent.
  • If the user doesn't exist in the system, the user will receive a notification on the view notifying of the same.
  • When the user clicks on the Reset Password button in the email, he/she will be redirected to a view where they can type in their preferred password.
  • The user can then click on Reset Password in the reset password view to complete the process.

How should this be manually tested?

  • Just click on the Forgot Password link in the login page to start the reset password process.
  • Test can be done for users who exist/ don't exist in the system.

Any background context you want to provide?

  • All password reset emails are hardcoded to be sent from [email protected]
  • A reset email cannot be used more than once.

What are the relevant Pivotal Tracker stories?

ID #115230531 - Forgot Password

Screenshot

screen shot 2016-04-04 at 11 40 39

screen shot 2016-04-04 at 11 40 48

screen shot 2016-04-04 at 11 40 28

@lewisemm lewisemm force-pushed the ft-forgot-password-115230531 branch 2 times, most recently from 5f195d6 to 4e64f48 Compare April 6, 2016 06:37
@coveralls
Copy link

Coverage Status

Coverage increased (+0.7%) to 93.815% when pulling 4e64f48 on ft-forgot-password-115230531 into ee514dd on develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.7%) to 93.815% when pulling f7cc335 on ft-forgot-password-115230531 into ee514dd on develop.

- Create a link at the login page to start the reset password process
- The link is clicked to call a modal dialog. This dialog has a field
where the email of the user whose password is being reset is typed in
- Configure the modal dialog's max-height to 90% to provide more space
to the elements within and reduce clutter
- Create a password reset model to store request details in the
database for verification and updating when during completion process
- Create a html template to be used in the PasswordReset model
- Create a serializer, viewset and register an API route to manage this
model using REST
- Change the link in the 'Reset Password' button in the reset email.
The previous link used to redirect to the api backend. The change
redirects to a url that maps to a view
- Update the limber.urls file to handle the password completion process
by redirecting to the 'password_reset_completion' view
- Create the 'password_reset_completion' view
- Refactor the create method of PasswordResetViewset. This method
has been defined to accept wither a 'user' (id) or 'an email' address.
When an email is given, it queries the UserAuthentication model to get
the user associated with the provided email and uses his/her id in the
serializer
- Include the 'request_date' as a read only field to enforce the current
date as the value of this field
- Adjust the authController to send the email data under the email key
- Create a PasswordReset resource to handle calls to the '/api/password/
reset/' route in the backend
- Move the html definition of the 'forgot password' modal to within
the scope of the controller so that programmatic activation is possible
Fix indentation and spacing in html code for layout page
- Create an update method that requires a 'new_password' argument to
change the password of the user associated with the PasswordReset object
- Create PUT functionality for PasswordReset resource in mainService
- Create the password reset controller to handle requests from the
password reset view
- Load the password reset controller in the parent view (layout.html)
- Include the password reset controller in the password reset view
- Fix error code to HTTP 404 when a PasswordRequest object is not found
- Create tests for the forgot password functionality.
- Center password reset form, use border, provide 'Limber' header for
navigation to the root url
- Define logic to check whether password request has been used before
attempting to update the password
- Fix bug at the PasswordReset model by checking whether the request
has been used before prior to sending reset email
- Display toast in the password reset view informing user that a
request has expired if it has been used before
- Create tests for a scenario where a user is attempting to re-use a
password request.
- Create a link to the login page at the password reset page
- Resolve Python 3 compatibility errors
@@ -115,7 +115,7 @@ def test_update_password_reset(self):
}
response = self.client.post(login_url, login_data)
self.assertEqual(response.status_code, 200)
self.assertTrue(response.data.has_key('token'))
self.assertTrue('token' in response.data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants